package com.hr.service;

import com.hr.dao.ArchiveDAO;
import com.hr.dao.DepartmentDAO;
import com.hr.model.Archive;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class ArchiveService
{
    @Autowired
    ArchiveDAO archiveDAO;
    @Autowired
    DepartmentDAO departmentDAO;

    public Archive getArchiveByAId(int aid)
    {
        return archiveDAO.getArchiveByAId(aid);
    }

    public Archive getArchiveByUId(int uid)
    {
        return archiveDAO.getArchiveByUId(uid);
    }

    public List<Archive> getAllArchives()
    {
        return archiveDAO.getAllArchives();
    }

    public List<Archive> getPublicArchives()
    {
        return archiveDAO.getPublicArchives();
    }

    public List<Archive> getArchivesByDepId(int depId)
    {
        return archiveDAO.getArchivesByDepId(depId);
    }

    public void insertArchiveByUId(int uid, Archive archive)
    {
        archiveDAO.insertArchiveByUId(uid, archive);
    }

    public void updateArchiveByAId(int aid, Archive archive)
    {
        archiveDAO.updateArchiveByAId(aid, archive);
    }

}
